#ifndef __render_engine_h__
#define __render_engine_h__

#ifdef WONDERLAND_APPLE 
  #include <Carbon/Carbon.h> 
  #include <CoreFoundation/CoreFoundation.h>
#endif
 
#include <input_listener.h>
#include "region.h"
#include <OgreString.h>
#include <list>
#include <string>

namespace Ogre {
	class Root;
	class Camera;
	class RenderWindow;
}

class RenderEngine : public Wonderland::Region{
public:
  RenderEngine();
  ~RenderEngine();
  void start();
  bool initialize();

  Ogre::RenderWindow* getWindow(){ return mWindow; };
  
  InputListener* getInputListener(){ return input_listener_; }
  
  int renderOneFrame();
private:
  Ogre::Root *mRoot;
  Ogre::Camera* mCamera;
  Ogre::RenderWindow* mWindow;
  InputListener *input_listener_;

  void setupResources();
  bool configure();
  void chooseSceneManager();
  void createFrameListener();
  void createViewports();
  void createResourceListener();
  void createCamera();
  void loadResources();

  void createScene();
  void destroyScene();
};

#endif